let mod = require("./mod/src/index")

if (!$power_manager.isIgnoringBatteryOptimizations()) {
    toastLog("未开启忽略电池优化，请求中...");
    $power_manager.requestIgnoreBatteryOptimizations();
    print("忽略成功")
    
}

print("随机数位：%d", random(10, -90))



mod.init({
    deBug: 1,
    autoServer: 1,
})

mod.login({
    user: "17685034710@163.com",
    key: "bvpb6pso6itf6809nh0g",
    secret: "92Uvn3hYLZSu6CuEX3y15sHbrqudBTG4"
})


mod.drawUI((
    <vertical>
        <text id="t" text="测试文本" />
        <input w="*" hint="请输入账号" id="bh_user"></input>
        <input w="*" hint="请输入密码" id="bh_pass"></input>
        <EditText text="你好" id="bh_bb"></EditText>
        <radio id="bh_radio"></radio>
        <checkbox id="bh_checkbox"></checkbox>
        <spinner id="bh_spinner" text="你好"></spinner>
        <seekbar id="bh_seek"></seekbar>
        <button id="ok" text="测试按钮"/>
    </vertical>
), function (window) {
    window.ok.click(() => {
        toastLog("点击了OK")
        ui.run(() => {
            window.t.setText("OKOK")
        })
    })
    
})



mod.run("./script.js")

